//
//  DYMessageCell.m
//  kafuMerchant
//
//  Created by 帝云科技 on 2018/9/19.
//  Copyright © 2018年 帝云科技. All rights reserved.
//

#import "DYMessageCell.h"

@interface DYMessageCell ()

@property (nonatomic,strong)UILabel *timeLabel;
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UILabel *contentLabel;
@property (nonatomic,strong)UILabel *seeLabel;
@property (nonatomic,strong)UILabel *lineLabel;
@property (nonatomic,strong)UIImageView  *arrow;


@end

@implementation DYMessageCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(void)dy_initUI
{
    [super dy_initUI];
    
    [self xhq_noneSelectionStyle];
    
    self.hideSeparatorLabel=YES;
    
    self.timeLabel =({
        UILabel *label=[Utils labelWithTitleFontSize:12 textColor:[UIColor xhq_content] alignment:1];
        label.backgroundColor=[UIColor xhq_grayblue];
        label;
    });
    
    self.bgView = ({
        UIView *view=[[UIView alloc]init];
        view.backgroundColor=WhiteColor;
        view;
    });
    
    self.titleLabel = ({
        UILabel *label=[Utils labelWithTitleFontSize:14 textColor:[UIColor xhq_aTitle] alignment:0];
        label;
    });
    
    self.contentLabel = ({
        UILabel *label=[Utils labelWithTitleFontSize:14 textColor:[UIColor xhq_content] alignment:0];
        label;
    });
    
    self.lineLabel = ({
        UILabel *line=[UILabel xhq_lineLabel];
        line;
    });
    
    self.seeLabel = ({
        UILabel *label=[Utils labelWithTitleFontSize:12 textColor:[UIColor xhq_content] alignment:0];
        label.text=@"查看详情";
        label;
    });
    
    self.arrow = ({
        UIImageView *imageView=[Utils imageViewWithImage:IMG(@"arrow_right")];
        imageView;
    });
    
    [self addSubview:self.timeLabel];
    [self addSubview:self.bgView];
    [self addSubview:self.titleLabel];
    [self addSubview:self.contentLabel];
    [self addSubview:self.seeLabel];
    [self addSubview:self.lineLabel];
    [self addSubview:self.arrow];
    
    [self.timeLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.equalTo(0);
        make.height.equalTo(BILIHEIGHT(30));
    }];
    
    
    [self.bgView makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(UIEdgeInsetsMake(BILIHEIGHT(30), 0, 0, 0));
    }];

    
    [self.titleLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(BILIWIDTH(10));
        make.top.equalTo(self.bgView).offset(BILIHEIGHT(12));
        make.height.equalTo(BILIHEIGHT(15));
    }];

    [self.contentLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(BILIWIDTH(10));
        make.right.equalTo(BILIWIDTH(-10));
        make.top.equalTo(self.titleLabel.bottom).offset(BILIHEIGHT(9));
        make.height.equalTo(BILIHEIGHT(60));
    }];

    [self.lineLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(0);
        make.top.equalTo(self.contentLabel.bottom).offset(BILIHEIGHT(5));
        make.height.equalTo(BILIWIDTH(0.7));
    }];

    [self.arrow makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(BILIWIDTH(-10));
        make.bottom.equalTo(self.bgView.bottom);
        make.height.equalTo(BILIHEIGHT(28));
    }];
    
    [self.seeLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(BILIWIDTH(10));
        make.centerY.equalTo(self.arrow);
        
    }];


    
    self.timeLabel.text=@"2017-09-08 12:43:44";
    self.titleLabel.text=@"卡福商家服务质量提高";

    self.contentLabel.text=@"卡福商家服务质量提高卡福商家服务质量提高卡福商家服务质量提高卡福商家服务质量提高卡福商家服务质量提高卡福商家服务质量提高卡福商家服务质量提高卡福商家服务质量提高";
    [self.contentLabel xhq_lineSpace:BILIHEIGHT(3)];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
